import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadDemo16 {
    public static void main(String[] args) {
        //使用 Executors.newFixedThreadPool(10) 能创建出固定包含 10 个线程的线程池.
        //返回值类型为 ExecutorService
        //通过 ExecutorService.submit 可以注册一个任务到线程池中.
        ExecutorService service = Executors.newFixedThreadPool(10);
        service.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("hello");
            }
        });
    }
}
